package com.peanut.boot.controller;

import com.peanut.boot.entiity.Cat;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @className: com.peanut.boot.controller-> HelloController
 * @description: 这个类是做做什么得吖，小朋友？
 * @author: chenhs
 * @createDate: 2021-09-20 18:50
 * @version: 1.0
 */
// @RestController = @Controller +  @ResponseBody(返回的数据，不加默认返回页面) ,
@Slf4j
@RestController
public class HelloController {
    @Autowired
    private Cat cat;
    @RequestMapping(value = "/cat")
    public String getCat() {
        return cat.toString() ;
    }
    @RequestMapping(value = "/test")
    public String name() {
        return "你好哇，小boot。";
    }

    @RequestMapping(value = "/testLog")
    public String testLog() {
        log.info("---------------打印信息-------------------");
        return "success";
    }
}
